package com.example.demomongodb.service.impl;

import com.example.demomongodb.entity.Welcome;
import com.example.demomongodb.service.WelcomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

/**
 * @version 1.0.0
 * @className: WelcomServiceImpl
 * @description:
 * @author: zhangjunfa
 * @date: 2022/11/8 11:33
 */
@Service
public class WelcomServiceImpl implements WelcomService {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public Object getOne() {
        return this.mongoTemplate.find(new Query(), Welcome.class);
    }
}
